package collection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.Random;

public class Test {
    public static void main(String[] args) {
        Collection<Integer> c=new ArrayList<>();
        Random ran=new Random();
        for(int i=1;i<=10;i++){
            c.add(ran.nextInt(100)+1);
        }
        System.out.println(c);
        Iterator<Integer> it=c.iterator();
        while(it.hasNext()){
            if(it.next()%2==0)//自动拆箱
                it.remove();
        }
        System.out.println(c);
    }
}
